<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>链家-郑州二手房源信息概览</title>
  </head>

  <body>

    <script>
      function Get(url, data = null) {
        return new Promise((resolve, reject) => {
          let xhr = new XMLHttpRequest();
          xhr.open('get', url);
          xhr.setRequestHeader('content-type', 'application/json');
          xhr.onreadystatechange = function () {
            if (xhr.readyState === 4) {
              if (xhr.status === 200) {
                resolve(JSON.parse(xhr.responseText));
              } else {
                reject(new Error());
              }
            }
          }
          xhr.send(data);
        })
      }

      Get('./data/streetlist.json').then(data => {
        // console.log(data[0]);
        Get(`./houseInfoData/${data[0].name}.json`).then(data => {
          console.log(data)
        })
      })
    </script>
  </body>

</html>
